#!/usr/bin/python
# -*- coding: utf-8 -*-

from db.employee_db import EmployeeDB
import utils.log_utils as log
import urllib

class EmployeeManager:

    def __init__(self):
        self.empdb = EmployeeDB()

    def query(self, name=None):
        if name and name != '':
            name = urllib.unquote(name)
        emplist = self.empdb.query(name)
        return emplist

    def query_cond(self, args):
        name = args.get('name')
        if name and name != '':
            args['name'] = urllib.unquote(name)
        emplist = self.empdb.query_cond(args)
        return emplist

    def query_dept(self):
        deptlist = self.empdb.query_dept()
        return deptlist

if __name__ == '__main__':
    manager = EmployeeManager()
    print manager.query()


